19. Clean Away "Signature Words"
Clean Away "Signature Words"
Question:
In
vectorize_text.py
, you will iterate through all the emails from Chris and from Sara. For each email, feed the opened email to
parseOutText()
and return the stemmed text string. Then do two things:
remove signature words (“sara”, “shackleton”, “chris”, “germani”--bonus points if you can figure out why it's "germani" and not "germany")
Once this step is complete, you should have two lists: one contains the stemmed text of each email, and the second should contain the labels that encode (via a 0 or 1) who the author of that email is.
Running over all the emails can take a little while (5 minutes or more), so we've added a temp_counter to cut things off after the first 200 emails. Of course, once everything is working, you'd want to run over the full dataset.
In the box below, put the string that you get for word_data[152].
Start Quiz:

INSTRUCTOR NOTE:
vectorize_text.py
can be found in the text_learning directory